-
Notifications
You must be signed in to change notification settings - Fork 1
Update abcjs version for Tune display and add additional abcjs-based tools #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- seems like abcjs is not ES6 so can't `import` - loading from CDN happens on widget creation, but not update - but currently creation controls where it shows up (the first #music, though update creates additional elements)
without needing to override __init__
seems like restarting notebook kernel won't get you to the first load, have to refresh the web page and it would be nice to display it at the same hierarchy level as the widget container, instead of within it could also add an option to include it within the widget when requested
tune.engraver.svgs also them, but not sure if the same thing or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the PyABC2 library to use abcjs version 6.4.4 and adds comprehensive widget-based rendering capabilities for ABC notation. The changes modernize the display system by replacing the previous custom JavaScript injection approach with anywidget, and add multiple new ways to render ABC notation including headless SVG creation via Node.js and HTML page generation.
Changes:
- Replaced custom abcjs loading in
Tune._repr_html_()with an anywidget-based implementation - Added
pyabc2.widgetmodule withABCJSWidgetclass andinteractive()function for Jupyter integration - Added
pyabc2.sheetmodule for headless SVG rendering via Node.js with abcjs - Added
pyabc2.htmlmodule for generating standalone HTML pages with embedded ABC rendering - Updated ReadTheDocs configuration to build Node.js dependencies and use Python 3.14 (invalid version)
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 23 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Added optional dependency groups for 'widget' and 'sheet' extras, updated sphinx constraint, added anywidget to dev dependencies |
| pyabc2/widget/index.js | New JavaScript module implementing anywidget interface for abcjs rendering with support for customization options |
| pyabc2/widget/index.css | Styling for widget debug modes and code display |
| pyabc2/widget/init.py | Python widget implementation with ABCJSWidget class and interactive editor function |
| pyabc2/sheet/render.js | Node.js module for headless SVG rendering using abcjs and jsdom |
| pyabc2/sheet/package.json | NPM package definition for abcjs rendering dependencies |
| pyabc2/sheet/cli.cjs | Command-line interface for Node.js rendering |
| pyabc2/sheet/init.py | Python interface to Node.js rendering with svg() and svg_to() functions |
| pyabc2/parse.py | Updated Tune.repr_html() to use new widget, removed old abcjs loading code |
| pyabc2/html.py | New module for generating standalone HTML pages with abcjs rendering |
| pyabc2/_util.py | Added in_jupyter() utility function |
| pyabc2/init.py | Removed automatic abcjs loading call |
| docs/index.md | Added widget example notebook to documentation index |
| docs/examples/widget.ipynb | Comprehensive examples demonstrating widget usage |
| docs/examples/types.ipynb | Added anchor reference for Tune type |
| docs/dev.md | Added documentation for widget development with hot reloading |
| docs/conf.py | Added abcjs script loading configuration for documentation |
| docs/api.rst | Added API documentation sections for widget and sheet modules |
| .readthedocs.yaml | Updated OS version, Python version to 3.14 (invalid), added pre-build job for npm install |
| .gitignore | Added patterns for node_modules, test files, and build artifacts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
for more information, see https://pre-commit.ci
these show up as description in the docs too
This reverts commit 870ea29. Seems like the npm build was not there in the docs build. Probably it built in the cloned repo pyabc2, not the installed one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 22 out of 23 changed files in this pull request and generated 11 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I don't know why codecov is reporting Eskin coverage so low. Those tests are running. Just going to merge for now. |
Now using anywidget for the display (
_repr_html_)More ways to use abcjs:
pyabc2.sheet, not sure about the module name)todo: